Change in openvpn[master]: configure: Handle libnl-genl and libcap-ng consistent with other libs
A message that is not in the archive (sent off-list or not yet received): gerrit.1723546478000.I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
to review the following change.
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
configure: Handle libnl-genl and libcap-ng consistent with other libs
Do not communicate any of the flags via the global CFLAGS and LIBS, so that users are not confused when overriding them on the command line.
---
M configure.ac
M src/openvpn/Makefile.am
2 files changed, 17 insertions(+), 9 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/724/1
configure.ac +13 -9
@@ -824,8 +824,8 @@ AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO]) ] ) - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + OPTIONAL_LIBNL_GENL_CFLAGS="${LIBNL_GENL_CFLAGS}" + OPTIONAL_LIBNL_GENL_LIBS="${LIBNL_GENL_LIBS}" AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
@@ -865,7 +865,6 @@ dnl case "$host" in *-*-linux*) - # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [],
@@ -873,8 +872,8 @@ ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) - CFLAGS="${CFLAGS} ${LIBCAPNG_CFLAGS}" - LIBS="${LIBS} ${LIBCAPNG_LIBS}" + OPTIONAL_LIBCAPNG_CFLAGS="${LIBCAPNG_CFLAGS}" + OPTIONAL_LIBCAPNG_LIBS="${LIBCAPNG_LIBS}" AC_DEFINE(HAVE_LIBCAPNG, 1, [Enable libcap-ng support]) ;; esac
@@ -1414,7 +1413,7 @@ # When testing a compiler option, we add -Werror to force # an error when the option is unsupported. This is not -# required for gcc, but some compilers such as clang needs it. +# required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" CFLAGS="$1 -Werror $CFLAGS"
@@ -1490,6 +1489,10 @@ AC_SUBST([OPTIONAL_SELINUX_LIBS]) AC_SUBST([OPTIONAL_CRYPTO_CFLAGS]) AC_SUBST([OPTIONAL_CRYPTO_LIBS]) +AC_SUBST([OPTIONAL_LIBCAPNG_CFLAGS]) +AC_SUBST([OPTIONAL_LIBCAPNG_LIBS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_CFLAGS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS]) AC_SUBST([OPTIONAL_LZO_CFLAGS]) AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS])
@@ -1534,10 +1537,11 @@ AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS}" +TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" -TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" +TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" AC_SUBST([TEST_LDFLAGS])
src/openvpn/Makefile.am +4 -0
@@ -24,6 +24,8 @@ AM_CFLAGS = \ $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ + $(OPTIONAL_LIBCAPNG_CFLAGS) \ + $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
@@ -147,6 +149,8 @@ openvpn_LDADD = \ $(top_builddir)/src/compat/libcompat.la \ $(SOCKETS_LIBS) \ + $(OPTIONAL_LIBCAPNG_LIBS) \ + $(OPTIONAL_LIBNL_GENL_LIBS) \ $(OPTIONAL_LZO_LIBS) \ $(OPTIONAL_LZ4_LIBS) \ $(OPTIONAL_PKCS11_HELPER_LIBS) \
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
to look at the new patch set (#2).
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
configure: Handle libnl-genl and libcap-ng consistent with other libs
Do not communicate any of the flags via the global CFLAGS and LIBS, so that users are not confused when overriding them on the command line.
Github: closes OpenVPN/openvpn#105
---
M configure.ac
M src/openvpn/Makefile.am
2 files changed, 17 insertions(+), 9 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/724/2
configure.ac +13 -9
@@ -824,8 +824,8 @@ AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO]) ] ) - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + OPTIONAL_LIBNL_GENL_CFLAGS="${LIBNL_GENL_CFLAGS}" + OPTIONAL_LIBNL_GENL_LIBS="${LIBNL_GENL_LIBS}" AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
@@ -865,7 +865,6 @@ dnl case "$host" in *-*-linux*) - # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [],
@@ -873,8 +872,8 @@ ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) - CFLAGS="${CFLAGS} ${LIBCAPNG_CFLAGS}" - LIBS="${LIBS} ${LIBCAPNG_LIBS}" + OPTIONAL_LIBCAPNG_CFLAGS="${LIBCAPNG_CFLAGS}" + OPTIONAL_LIBCAPNG_LIBS="${LIBCAPNG_LIBS}" AC_DEFINE(HAVE_LIBCAPNG, 1, [Enable libcap-ng support]) ;; esac
@@ -1414,7 +1413,7 @@ # When testing a compiler option, we add -Werror to force # an error when the option is unsupported. This is not -# required for gcc, but some compilers such as clang needs it. +# required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" CFLAGS="$1 -Werror $CFLAGS"
@@ -1490,6 +1489,10 @@ AC_SUBST([OPTIONAL_SELINUX_LIBS]) AC_SUBST([OPTIONAL_CRYPTO_CFLAGS]) AC_SUBST([OPTIONAL_CRYPTO_LIBS]) +AC_SUBST([OPTIONAL_LIBCAPNG_CFLAGS]) +AC_SUBST([OPTIONAL_LIBCAPNG_LIBS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_CFLAGS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS]) AC_SUBST([OPTIONAL_LZO_CFLAGS]) AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS])
@@ -1534,10 +1537,11 @@ AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS}" +TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" -TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" +TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" AC_SUBST([TEST_LDFLAGS])
src/openvpn/Makefile.am +4 -0
@@ -24,6 +24,8 @@ AM_CFLAGS = \ $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ + $(OPTIONAL_LIBCAPNG_CFLAGS) \ + $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
@@ -147,6 +149,8 @@ openvpn_LDADD = \ $(top_builddir)/src/compat/libcompat.la \ $(SOCKETS_LIBS) \ + $(OPTIONAL_LIBCAPNG_LIBS) \ + $(OPTIONAL_LIBNL_GENL_LIBS) \ $(OPTIONAL_LZO_LIBS) \ $(OPTIONAL_LZ4_LIBS) \ $(OPTIONAL_PKCS11_HELPER_LIBS) \
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
to look at the new patch set (#3).
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
configure: Handle libnl-genl and libcap-ng consistent with other libs
Do not communicate any of the flags via the global CFLAGS and LIBS, so that users are not confused when overriding them on the command line.
Github: closes OpenVPN/openvpn#586
---
M configure.ac
M src/openvpn/Makefile.am
2 files changed, 17 insertions(+), 9 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/724/3
configure.ac +13 -9
@@ -824,8 +824,8 @@ AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO]) ] ) - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + OPTIONAL_LIBNL_GENL_CFLAGS="${LIBNL_GENL_CFLAGS}" + OPTIONAL_LIBNL_GENL_LIBS="${LIBNL_GENL_LIBS}" AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
@@ -865,7 +865,6 @@ dnl case "$host" in *-*-linux*) - # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [],
@@ -873,8 +872,8 @@ ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) - CFLAGS="${CFLAGS} ${LIBCAPNG_CFLAGS}" - LIBS="${LIBS} ${LIBCAPNG_LIBS}" + OPTIONAL_LIBCAPNG_CFLAGS="${LIBCAPNG_CFLAGS}" + OPTIONAL_LIBCAPNG_LIBS="${LIBCAPNG_LIBS}" AC_DEFINE(HAVE_LIBCAPNG, 1, [Enable libcap-ng support]) ;; esac
@@ -1414,7 +1413,7 @@ # When testing a compiler option, we add -Werror to force # an error when the option is unsupported. This is not -# required for gcc, but some compilers such as clang needs it. +# required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" CFLAGS="$1 -Werror $CFLAGS"
@@ -1490,6 +1489,10 @@ AC_SUBST([OPTIONAL_SELINUX_LIBS]) AC_SUBST([OPTIONAL_CRYPTO_CFLAGS]) AC_SUBST([OPTIONAL_CRYPTO_LIBS]) +AC_SUBST([OPTIONAL_LIBCAPNG_CFLAGS]) +AC_SUBST([OPTIONAL_LIBCAPNG_LIBS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_CFLAGS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS]) AC_SUBST([OPTIONAL_LZO_CFLAGS]) AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS])
@@ -1534,10 +1537,11 @@ AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS}" +TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" -TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" +TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" AC_SUBST([TEST_LDFLAGS])
src/openvpn/Makefile.am +4 -0
@@ -24,6 +24,8 @@ AM_CFLAGS = \ $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ + $(OPTIONAL_LIBCAPNG_CFLAGS) \ + $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
@@ -147,6 +149,8 @@ openvpn_LDADD = \ $(top_builddir)/src/compat/libcompat.la \ $(SOCKETS_LIBS) \ + $(OPTIONAL_LIBCAPNG_LIBS) \ + $(OPTIONAL_LIBNL_GENL_LIBS) \ $(OPTIONAL_LZO_LIBS) \ $(OPTIONAL_LZ4_LIBS) \ $(OPTIONAL_PKCS11_HELPER_LIBS) \
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/724?usp=email )
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
Patch Set 3: Code-Review-1
(3 comments)
Patchset:
PS3:
Feature-ACK, but it does not work for me.
I applied this against 14d2db6cd41fb6 on Ubuntu 20.04, did autoreconf -vif then configure, make, and it fails for me with
```
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I../../src/compat -I/usr/include/lzo -DPLUGIN_LIBDIR=\"/usr/local/lib/openvpn/plugins\" -Wall -Wno-stringop-truncation -g -O2 -std=c11 -MT options.o -MD -MP -MF $depbase.Tpo -c -o options.o options.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from dco_internal.h:31,
from dco.h:31,
from tun.h:43,
from socket.h:37,
from ssl.h:38,
from options.c:45:
dco_linux.h:31:10: fatal error: netlink/socket.h: No such file or directory
31 | #include <netlink/socket.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
```because the LIBNL_GENL_CFLAGS do not show up on the gcc command line...
File configure.ac:
http://gerrit.openvpn.net/c/openvpn/+/724/comment/546e2b93_7afac6b6 :
PS3, Line 1495: AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS])
so what are these needed for? I see that the generated src/openvpn/Makefile has both
``` LIBNL_GENL_CFLAGS = -I/usr/include/libnl3 LIBNL_GENL_LIBS = -lnl-genl-3 -lnl-3 ``` and ``` OPTIONAL_LIBNL_GENL_CFLAGS = -I/usr/include/libnl3 OPTIONAL_LIBNL_GENL_LIBS = -lnl-genl-3 -lnl-3 ```
so this seems slightly redundant...
http://gerrit.openvpn.net/c/openvpn/+/724/comment/97ee1a30_d7a7fbe2 :
PS3, Line 1545: TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" This is TEST_* only, but shouldn't we have these for AM_CFLAGS and openvpn_LDADD as well?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 17 Sep 2024 13:12:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: cron2, plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/724?usp=email )
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
Patch Set 3:
(3 comments)
Patchset:
PS3:
Quoted 1 line
Feature-ACK, but it does not work for me. […]
hmm, works for me.
File configure.ac:
http://gerrit.openvpn.net/c/openvpn/+/724/comment/a0cd9504_a65fc9b8 :
PS3, Line 1495: AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS])
Quoted 1 line
so what are these needed for? I see that the generated
src/openvpn/Makefilehas both […]
Yeah, I assume this is related to that LIBNL_GENL_CFLAGS is automatically generated by PKG_CHECK_MODULES. The OPTIONAL_ makes sure we have a consistent place to put the arguments that we completely control. But in this case I just made the code consistent.
http://gerrit.openvpn.net/c/openvpn/+/724/comment/3aa88266_2f45c1c9 :
PS3, Line 1545: TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}"
Quoted 1 line
This is
TEST_*only, but shouldn't we have these forAM_CFLAGSandopenvpn_LDADDas well?
This is handled by the patch in Makefile.am
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Comment-Date: Tue, 17 Sep 2024 13:28:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/724?usp=email )
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
Patch Set 3: Code-Review+2
(1 comment)
Patchset:
PS3:
yeah, only got a partial diff. With the Makefile.am patch added it works ;-)
I do wonder about the doubling of all the LDFLAGS/CFLAGS variables, and if we can get rid of half of them...
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 17 Sep 2024 13:32:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v3 1/1 configure: Handle libnl-genl and libcap-ng consistent with other libs
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]...>
Do not communicate any of the flags via the global CFLAGS and LIBS, so that users are not confused when overriding them on the command line.
Github: closes OpenVPN/openvpn#586
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/724
This mail reflects revision 3 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
configure.ac +13 -9
@@ -824,8 +824,8 @@ AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO]) ] ) - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + OPTIONAL_LIBNL_GENL_CFLAGS="${LIBNL_GENL_CFLAGS}" + OPTIONAL_LIBNL_GENL_LIBS="${LIBNL_GENL_LIBS}" AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
@@ -865,7 +865,6 @@ dnl case "$host" in *-*-linux*) - # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [],
@@ -873,8 +872,8 @@ ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) - CFLAGS="${CFLAGS} ${LIBCAPNG_CFLAGS}" - LIBS="${LIBS} ${LIBCAPNG_LIBS}" + OPTIONAL_LIBCAPNG_CFLAGS="${LIBCAPNG_CFLAGS}" + OPTIONAL_LIBCAPNG_LIBS="${LIBCAPNG_LIBS}" AC_DEFINE(HAVE_LIBCAPNG, 1, [Enable libcap-ng support]) ;; esac
@@ -1414,7 +1413,7 @@ # When testing a compiler option, we add -Werror to force # an error when the option is unsupported. This is not -# required for gcc, but some compilers such as clang needs it. +# required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" CFLAGS="$1 -Werror $CFLAGS"
@@ -1490,6 +1489,10 @@ AC_SUBST([OPTIONAL_SELINUX_LIBS]) AC_SUBST([OPTIONAL_CRYPTO_CFLAGS]) AC_SUBST([OPTIONAL_CRYPTO_LIBS]) +AC_SUBST([OPTIONAL_LIBCAPNG_CFLAGS]) +AC_SUBST([OPTIONAL_LIBCAPNG_LIBS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_CFLAGS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS]) AC_SUBST([OPTIONAL_LZO_CFLAGS]) AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS])
@@ -1534,10 +1537,11 @@ AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS}" +TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" -TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" +TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" AC_SUBST([TEST_LDFLAGS])
src/openvpn/Makefile.am +4 -0
@@ -24,6 +24,8 @@ AM_CFLAGS = \ $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ + $(OPTIONAL_LIBCAPNG_CFLAGS) \ + $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
@@ -147,6 +149,8 @@ openvpn_LDADD = \ $(top_builddir)/src/compat/libcompat.la \ $(SOCKETS_LIBS) \ + $(OPTIONAL_LIBCAPNG_LIBS) \ + $(OPTIONAL_LIBNL_GENL_LIBS) \ $(OPTIONAL_LZO_LIBS) \ $(OPTIONAL_LZ4_LIBS) \ $(OPTIONAL_PKCS11_HELPER_LIBS) \
[Openvpn-devel] [PATCH applied] Re: configure: Handle libnl-genl and libcap-ng consistent with other libs
Tested on ubuntu 2004 which needs all these, looked at the resulting Makefile.am/Makefile.in/Makefile and it works.
I do wonder why we double all these variables, though...
Your patch has been applied to the master branch.
commit b236261f9ce14bc9fffbb81c61938e0e24b200d6
Author: Frank Lichtenheld Date: Tue Sep 17 15:32:53 2024 +0200
configure: Handle libnl-genl and libcap-ng consistent with other libs
Signed-off-by: Frank Lichtenheld <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29282.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#4) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/724?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
configure: Handle libnl-genl and libcap-ng consistent with other libs
Do not communicate any of the flags via the global CFLAGS and LIBS, so that users are not confused when overriding them on the command line.
Github: closes OpenVPN/openvpn#586
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29282.html
---
M configure.ac
M src/openvpn/Makefile.am
2 files changed, 17 insertions(+), 9 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/724/4
configure.ac +13 -9
@@ -802,8 +802,8 @@ AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO]) ] ) - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + OPTIONAL_LIBNL_GENL_CFLAGS="${LIBNL_GENL_CFLAGS}" + OPTIONAL_LIBNL_GENL_LIBS="${LIBNL_GENL_LIBS}" AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
@@ -843,7 +843,6 @@ dnl case "$host" in *-*-linux*) - # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [],
@@ -851,8 +850,8 @@ ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) - CFLAGS="${CFLAGS} ${LIBCAPNG_CFLAGS}" - LIBS="${LIBS} ${LIBCAPNG_LIBS}" + OPTIONAL_LIBCAPNG_CFLAGS="${LIBCAPNG_CFLAGS}" + OPTIONAL_LIBCAPNG_LIBS="${LIBCAPNG_LIBS}" AC_DEFINE(HAVE_LIBCAPNG, 1, [Enable libcap-ng support]) ;; esac
@@ -1401,7 +1400,7 @@ # When testing a compiler option, we add -Werror to force # an error when the option is unsupported. This is not -# required for gcc, but some compilers such as clang needs it. +# required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" CFLAGS="$1 -Werror $CFLAGS"
@@ -1477,6 +1476,10 @@ AC_SUBST([OPTIONAL_SELINUX_LIBS]) AC_SUBST([OPTIONAL_CRYPTO_CFLAGS]) AC_SUBST([OPTIONAL_CRYPTO_LIBS]) +AC_SUBST([OPTIONAL_LIBCAPNG_CFLAGS]) +AC_SUBST([OPTIONAL_LIBCAPNG_LIBS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_CFLAGS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS]) AC_SUBST([OPTIONAL_LZO_CFLAGS]) AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS])
@@ -1521,10 +1524,11 @@ AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS}" +TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" -TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" +TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" AC_SUBST([TEST_LDFLAGS])
src/openvpn/Makefile.am +4 -0
@@ -24,6 +24,8 @@ AM_CFLAGS = \ $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ + $(OPTIONAL_LIBCAPNG_CFLAGS) \ + $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
@@ -147,6 +149,8 @@ openvpn_LDADD = \ $(top_builddir)/src/compat/libcompat.la \ $(SOCKETS_LIBS) \ + $(OPTIONAL_LIBCAPNG_LIBS) \ + $(OPTIONAL_LIBNL_GENL_LIBS) \ $(OPTIONAL_LZO_LIBS) \ $(OPTIONAL_LZ4_LIBS) \ $(OPTIONAL_PKCS11_HELPER_LIBS) \
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/724?usp=email )
Change subject: configure: Handle libnl-genl and libcap-ng consistent with other libs
......................................................................
configure: Handle libnl-genl and libcap-ng consistent with other libs
Do not communicate any of the flags via the global CFLAGS and LIBS, so that users are not confused when overriding them on the command line.
Github: closes OpenVPN/openvpn#586
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29282.html
---
M configure.ac
M src/openvpn/Makefile.am
2 files changed, 17 insertions(+), 9 deletions(-)
configure.ac +13 -9
@@ -802,8 +802,8 @@ AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO]) ] ) - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + OPTIONAL_LIBNL_GENL_CFLAGS="${LIBNL_GENL_CFLAGS}" + OPTIONAL_LIBNL_GENL_LIBS="${LIBNL_GENL_LIBS}" AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
@@ -843,7 +843,6 @@ dnl case "$host" in *-*-linux*) - # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [],
@@ -851,8 +850,8 @@ ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) - CFLAGS="${CFLAGS} ${LIBCAPNG_CFLAGS}" - LIBS="${LIBS} ${LIBCAPNG_LIBS}" + OPTIONAL_LIBCAPNG_CFLAGS="${LIBCAPNG_CFLAGS}" + OPTIONAL_LIBCAPNG_LIBS="${LIBCAPNG_LIBS}" AC_DEFINE(HAVE_LIBCAPNG, 1, [Enable libcap-ng support]) ;; esac
@@ -1401,7 +1400,7 @@ # When testing a compiler option, we add -Werror to force # an error when the option is unsupported. This is not -# required for gcc, but some compilers such as clang needs it. +# required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" CFLAGS="$1 -Werror $CFLAGS"
@@ -1477,6 +1476,10 @@ AC_SUBST([OPTIONAL_SELINUX_LIBS]) AC_SUBST([OPTIONAL_CRYPTO_CFLAGS]) AC_SUBST([OPTIONAL_CRYPTO_LIBS]) +AC_SUBST([OPTIONAL_LIBCAPNG_CFLAGS]) +AC_SUBST([OPTIONAL_LIBCAPNG_LIBS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_CFLAGS]) +AC_SUBST([OPTIONAL_LIBNL_GENL_LIBS]) AC_SUBST([OPTIONAL_LZO_CFLAGS]) AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS])
@@ -1521,10 +1524,11 @@ AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS}" +TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" -TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" +TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" AC_SUBST([TEST_LDFLAGS])
src/openvpn/Makefile.am +4 -0
@@ -24,6 +24,8 @@ AM_CFLAGS = \ $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ + $(OPTIONAL_LIBCAPNG_CFLAGS) \ + $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
@@ -147,6 +149,8 @@ openvpn_LDADD = \ $(top_builddir)/src/compat/libcompat.la \ $(SOCKETS_LIBS) \ + $(OPTIONAL_LIBCAPNG_LIBS) \ + $(OPTIONAL_LIBNL_GENL_LIBS) \ $(OPTIONAL_LZO_LIBS) \ $(OPTIONAL_LZ4_LIBS) \ $(OPTIONAL_PKCS11_HELPER_LIBS) \
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/724?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39a6f58b11b922f5dbd3e55a5bc8574eda8a83fe
Gerrit-Change-Number: 724
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged